package pl.cezary.butler.walili.server;
import pl.cezary.butler.walili.common.Task;
// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 

import java.util.Comparator;

// #[regen=yes,id=DCE.FAB51807-EB6C-9820-4C7B-54B01C49CE9F]
// </editor-fold> 
public class TaskPriorityComparator implements Comparator<Task>{

    private static Comparator<Task> instance = new TaskPriorityComparator();
    
    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.7CC0B579-A317-5A88-7F7C-4598BEEFF529]
    // </editor-fold> 
    private TaskPriorityComparator () {
    }
    
    public static Comparator getInstance(){
        return ( instance == null)?( instance = new TaskPriorityComparator()): instance;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.2A0FE1C4-B08E-485D-C768-B32F5BEBF9F2]
    // </editor-fold> 
    @Override
    public boolean equals (Object object) {
        return object.getClass() == this.getClass();
    }

    public int compare(Task arg0, Task arg1) {
        return arg0.getPriorytet() - arg1.getPriorytet();
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }

}

